<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"       xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/resources/templates/template_site.xhtml">

        <ui:define name="content">

             
                <p:panel header="#{bundle.CreatePhotosTitle}" >
                    <h:panelGroup id="messagePanel" layout="block">
                        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                    </h:panelGroup>
                    <p:panelGrid columns="2">
                        <h:outputLabel value="#{bundle.CreatePhotosLabel_photo}" for="photo" />
                        <p:fileUpload fileUploadListener="#{photosController.processFileUpload}" mode="advanced"  
                                      allowTypes="/(\.|\/)(gif|jpeg|png)$/" sizeLimit="1000000" id="photo" />                                                           
                        <h:outputLabel value="#{bundle.CreatePhotosLabel_iditem}" for="iditem" />
                        <p:selectOneMenu id="iditem" value="#{photosController.selected.iditem}" title="#{bundle.CreatePhotosTitle_iditem}" required="true" requiredMessage="#{bundle.CreatePhotosRequiredMessage_iditem}">
                            <f:selectItems value="#{itemController.itemsAvailableSelectOne}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <br />
                    <h:commandLink action="#{photosController.create}" value="#{bundle.CreatePhotosSaveLink}" />
                    <br />
                    <br />
                    <h:commandLink action="#{photosController.prepareList}" value="#{bundle.CreatePhotosShowAllLink}" immediate="true"/>
                    <br />
                    <br />
                    <h:commandLink value="#{bundle.CreatePhotosIndexLink}" action="/pages/index" immediate="true" />
                </p:panel>
             
        </ui:define>
    </ui:composition>

</html>
